from Utils import floor_to_zero,normalize
from math import fabs as abs

class HDRNormalizer:

    def __init__(self):
        pass

    def normalize_hdr(self, hdr):
        pass


class AdditiveHDRNormalizer(HDRNormalizer):
    '''
    TODO: Docstring
    '''
    
    def __init__(self):
        pass

    def normalize_hdr(self, hdr):
        smallest = 0.00
        potential = sorted(hdr).pop(0)
        smallest = smallest if smallest < potential else potential
        new_hdr = [abs(smallest)+val for val in hdr]
        return new_hdr

# You're ugly

class FloorHDRNormalizer(HDRNormalizer):

    def __init__(self):
        pass

    def normalize_hdr(self, hdr):
        new_hdr = normalize(hdr)
        new_hdr = [50.0*floor_to_zero(val) for val in new_hdr]
#        new_hdr = [floor_to_zero(val) for val in hdr]
        return new_hdr
